<%
	//session id 
	String userid = (String) session.getValue("user");
	List personList = PersonService.$.getPersons(userid);
	
	String user = request.getParameter("userid");
	System.out.println("user=============" + user);
	Person person = PersonService.$.getPerson(user);
	String personType = PersonService.$.getPersonType(person);
	Person createPerson = PersonService.$.getCreatePerson(person);
	boolean canEdit = false;
	if(createPerson != null && createPerson.getUserid().equals(user)) {
		canEdit = false;
	} else {
		canEdit = true; 
	}
 %>

<fieldset>
	<legend>修改用户</legend>
		<table align="left"  border="1px">
			<tr>
				<th style="background: #000000;"><font color="white">Filter</font></th>
				<td>
					<select id="personType" class="required" name="personType">
						<%
							List accessGroups = (List) AccessGroupService.$.getGroups(); 
							for(int i = 0; i < accessGroups.size(); i++) {
						%>
	                   <option value="<%= accessGroups.get(i) %>" <%=((String) accessGroups.get(i)).equals(personType)?"selected":"" %> ><%= accessGroups.get(i) %></option>
						<%
							}
						 %>
	               </select>
				</td>
			</tr>
		</table>
		<table align="left"  border="1px">
			<thead>
				<tr>
					<th>用户组</th>
					<th>用户名</th>
					<th>姓名</th>
					<th>电子邮箱</th>
					<th>电话</th>
					<th>密码</th>
					<th>性别</th>
					<th>生日</th>
					<th>创建人</th>
					<th>创建时间</th>
				</tr>
			</thead>
			<tbody id="persons">

				<tr>
					<td>
						<%= person.getUserid()%>
					</td>
					<td><%= person.getPassword()%></td>
					<td>
					</td>
					<td>
					</td>					
					<td>
					</td>
					<td>
					</td>		
					<td>
					</td>
					<td>
					</td>					
					<td>
					</td>
					<td>
					</td>			
				</tr>	
			</tbody>
		</table>
</fieldset>
<p>
	<input type="button" value="保存" onclick="editPerson(this);">
</p>
<script type="text/javascript">
</script>

<%@ page import="java.util.*" %>
<%@ page import="com.esms.bean.Person" %>
<%@ page import="com.esms.struts.service.*" %>
<%@ page language="java" contentType="text/html; charset=utf-8" %>